package com.example.workflow.service;

import org.flowable.engine.RepositoryService;
import org.flowable.engine.repository.Deployment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ProcessService {

    @Autowired
    private RepositoryService repositoryService;

    public Deployment deployProcess() {
        return repositoryService.createDeployment()
                .addClasspathResource("processes/leave-process.bpmn20.xml")
                .name("请假流程")
                .enableDuplicateFiltering()
                .deploymentProperty("generateDiagram", "true")  // 生成图形信息
                .deploy();
    }
} 